package tpsi.pong;

public class IDGenerator {
	private long currentID;

	public IDGenerator() {
		this.currentID = 0;
	}

	/**
	 * Generate and return identifier.
	 * 
	 * @return next id.
	 */
	public synchronized long getNextID() {
		if (this.currentID == Long.MAX_VALUE)
			this.currentID = 0;
		return this.currentID++;
	}
}
